package main

import (
	"fmt"
	"time"
)

func main() {
	time1 := time.Now()
	var N1, N2 float64

	for i := 1; i <= 10; i++ {
		N1, N2 = YyFloat64AddSub(0, 314159265)
	}
	fmt.Printf("单次平均耗时：%d ms, 结果:( %f, %f)", time.Now().Sub(time1).Milliseconds()/10, N1, N2)
}

// 1亿次浮点型加减法混合运算
func YyFloat64AddSub(N1 float64, N2 float64) (float64, float64) {
	for i := 1; i <= 100000000; i++ {
		N1 += 3.14
		N2 -= 3.14
	}
	return N1, N2
}
